package com.abm.entity;

import android.app.ListActivity;
import android.app.NotificationManager;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

public class ListaActividad extends ListActivity {

	// private static Comunicacion miCom;
	public static boolean cerrarAplicacion;
	public static final int MENU_SALIR = Menu.FIRST;

	public static boolean desconectadoDelServidor = false;
	public static boolean appRunning = false;
	public static boolean islogueado = false;
	public static int sat_count;

	public static boolean enviarLoginDesconectado;
	public static int NOTIFICATION = android.R.string.yes;
	public static NotificationManager mNM;
	public String TAG = "ACTIVIDAD";
	Intent intent;
	public static String usuarioActivo = "";
	public static String aux_banderas = "";

	public static boolean isPathActive = false;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
		if (!isTaskRoot()) {
			final Intent intent = getIntent();
			final String intentAction = intent.getAction();
			if (intent.hasCategory(Intent.CATEGORY_LAUNCHER)
					&& intentAction != null
					&& intentAction.equals(Intent.ACTION_MAIN)) {
				Log.i(TAG,
						"Main Activity is not the root.  Finishing Main Activity instead of launching.");
				finish();
				return;
			}
		}

	
	}

	@Override
	public void setContentView(int id) {
		super.setContentView(id);
		// setTitle();
	}

	@SuppressWarnings("null")
	public static void ActivarMenuItem(int Opsel) {
		MenuItem menu = null;
		switch (Opsel) {
		case MENU_SALIR:
			((MenuItem) menu).setEnabled(true);
			break;

		}
	}

	public void setTitle() {
		// if ( custom )
		// getWindow().setFeatureInt(Window.FEATURE_NO_TITLE, 0);
		// getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.);

	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// menu.add(0, MENU_SALIR, 0,
		// getResources().getString(R.string.volver)).setIcon(android.R.drawable.ic_lock_power_off);
		// menu.add(0, MENU_INFOCEL, 0,
		// getResources().getString(R.string.estado)).setIcon(R.drawable.mobilephone);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem menu) {
		switch (menu.getItemId()) {
		case MENU_SALIR:
			finish();
			return true;
		}
		return false;
	}

}
